package com.slg.android.manyanime.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.slg.android.manyanime.fragment.CartoonCategoryFragment;
import com.slg.android.manyanime.fragment.CartoonHotFragment;
import com.slg.android.manyanime.fragment.CartoonNewestFragment;

/**
 * Created by Thinkpad on 2015/3/11.
 */
public class CartoonFragmentAdapter extends FragmentStatePagerAdapter
{
    public CartoonFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment=null;
        switch (position){
            case 0:
                fragment=new CartoonHotFragment();
                break;
            case 1:
                fragment=new CartoonCategoryFragment();
                break;
            case 2:
                fragment=new CartoonNewestFragment();
                break;

        }
        return fragment;

    }

    @Override
    public int getCount() {
        return 3;
    }
}

